
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>注册</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="shortcut icon" type="image/x-icon" href="https://wwl.ycws.cc/image/backgroundimage/e.ico">
	<script src="js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript">	
	$(function(){
			$("#add").click(function(){
				var name=$("#yname").val();//原密码
				var sex=$("#ysex").val();//修改类型	
				var phone=$("#yphone").val();//新密码
				var sfzid=$("#ysfzid").val();//小区地址
				var patrn=/^(\w){6,20}$/;   
				//判断上传要求
				if(name == ""){
					alert("请输入原密码");
				}else if(phone == ""){
					alert("请输入新密码");
				}else if (!patrn.exec(phone)) {
					alert("只能输入6-20个字母、数字、下划线 ");
				}else{	
					var paer = {yname:name,ysex:sex,cardnumber:phone,yaddress:sfzid};
					$.ajax({
	    				url:"${path}/bassm/user/modifythepasswordto",
	    				data:paer,
	    				type:"post",
	    				async:false,
	    				success:function(date){
							if(date.msg==1){		
								var xq=date.detailed;
								window.location.href = "${path}/bassm/user/visitorsuser2?Celladdress="+xq;
								alert("成功");
							}else if(date.msg==2){
								alert("原密码不对");
								}else{
								alert("网络错误，请稍后在试");
							}
						},
						error:function(){
							alert("异常错误，请联系供应商");
						}
	    			});
			}
		});
	});
	</script>
	<script type="text/javascript">
	function selcetuserdz(address){
		var xq = address;
		window.location.href = "${path}/bassm/user/visitorsuser2?Celladdress="+xq;
	}
	</script>

	</head>
	<body style="margin:0px" >
	<div style="height: 150px"></div>
  		<div align="center" style="padding-top:6px; background-color: #f0f0f0">
    	<form id="addform" method="post" enctype="multipart/form-data" style="padding-right: 32%;" >
    		<table border="0"  cellpadding="0" cellspacing="0">
    		
    		<tr>
	    		<td height="85" align="right">修改类型 :</td>
	    		<td colspan="2" align="left">
	    			<select name="ysex"  id ="ysex" style="width: 270px; height: 40px;">
	    				<option value="2">业主密码</option>
	    				<option value="3">访客密码</option>
	    			</select>
	    		</td>
    		</tr> 
    		<tr>
	    		<td height="85" align="right">原密码:</td>
	    		<td colspan="2" align="left">
	    			<input type="text" name="yname" id="yname" value="" style="width: 270px; height: 40px;"/>
	    		</td>
	    		
    		</tr>
    		<tr>
    		<td height="85" align="right">输入新密码:</td>
	    		<td  colspan="2" align="left">
	    			<input type="text" name="yphone" id="yphone"   style="width:270px; height:40px;" />
	    		</td>
    		</tr>
    		<tr>
    		<td height="85" align="left">小区地址:</td>
	    		<td  colspan="2" align="left">
	    			<input type="text" name="ysfzid" id="ysfzid" disabled="true"  value="${address}" style="width:270px; height:40px;" />
	    		</td>
    		</tr> 			
    		<tr align="right" >
    		<td></td>
    			<td colspan="3" height="75px;">
    				<input type="button" id="add" value="提交" style="width: 160px; height: 40px; background-color: #FF0000; color: white; font-size: 20px;"/>
    				<input type="button" id="selcetuser"  onclick="selcetuserdz('${address}')" value="返回" style="width: 160px; height: 40px; background-color: #FF0000; color: white; font-size: 20px;"/>
    				
    			</td>
    		</tr>
    		</table>
    	</form>
    	</div>
  <div align="center">
  <p style="font-size: 15">咨询电话：0755-86133729　　公司地址：广东省深圳市龙华新区留仙大道24号彩悦大厦10楼</p>
  <p style="font-size: 15">&copy;   2013-2015深圳市万物联有限公司版权所有　丨　粤ICP备13071979号-2</p>
  </div>	
  </body>
</html>
